package com.collections;

import java.util.PriorityQueue;
import java.util.Queue;

public class QueueTest1 {
    public static void main(String[] args) {
        //先进先出
        Queue queue = new PriorityQueue();
        queue.add("123");
        queue.add("456");
        queue.add("789");
        //获取不删除
        String result = (String) queue.peek();
        //获取删除
        String result2 = (String) queue.poll();
        System.out.println(result);
        System.out.println(queue.size());
    }
}
